package com.heima.day528_二维数组;

import java.util.Scanner;

public class calc {
    //calc
    public static void main(String[] args) {

        calc();

    }

    public static void calc() {
        //键盘录入
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入第一个数：");
        int numA = sc.nextInt();
        System.out.println("请输入1 +，2 - ，3× ，4 ÷");
        int sF = sc.nextInt();
        System.out.println("请输入第二个数：");
        int numB = sc.nextInt();
        //根据输入提示键盘录入进行算法判断
        int ok = 0;
        if (sF == 1) {
            ok = numA + numB;
            System.out.println(numA + "+" + numB + " = " + ok);
        } else if (sF == 2) {
            ok = numA - numB;
            System.out.println(numA + "-" + numB + " = " + ok);
        } else if (sF == 3) {
            ok = numA * numB;
            System.out.println(numA + "×" + numB + " = " + ok);
        } else if (sF == 4) {
            ok = numA / numB;
            System.out.println(numA + "÷" + numB + " = " + ok);
        } else {
            System.out.println("输入错误");
        }

    }


}
